package com.hpe.jms;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * Created by tiansha on 2015/11/12.
 */

@Component
public class Sender {

    @Autowired
    private JmsTemplate jmsTemplate;

    //@Scheduled(fixedDelay = 1000L) // cron = "0/5 * *  * * ? "
    public void send() {
        this.jmsTemplate.convertAndSend("testQueue", "Hello");
    }

}

